/**
 */
package org.xtext.context.aware.eventX.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.xtext.context.aware.eventX.EventXPackage;
import org.xtext.context.aware.eventX.PlayMedia;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Play Media</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.context.aware.eventX.impl.PlayMediaImpl#getPlayMedia <em>Play Media</em>}</li>
 *   <li>{@link org.xtext.context.aware.eventX.impl.PlayMediaImpl#getMediaFileName <em>Media File Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PlayMediaImpl extends MinimalEObjectImpl.Container implements PlayMedia
{
  /**
   * The default value of the '{@link #getPlayMedia() <em>Play Media</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPlayMedia()
   * @generated
   * @ordered
   */
  protected static final String PLAY_MEDIA_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getPlayMedia() <em>Play Media</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPlayMedia()
   * @generated
   * @ordered
   */
  protected String playMedia = PLAY_MEDIA_EDEFAULT;

  /**
   * The default value of the '{@link #getMediaFileName() <em>Media File Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMediaFileName()
   * @generated
   * @ordered
   */
  protected static final String MEDIA_FILE_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getMediaFileName() <em>Media File Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMediaFileName()
   * @generated
   * @ordered
   */
  protected String mediaFileName = MEDIA_FILE_NAME_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected PlayMediaImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return EventXPackage.Literals.PLAY_MEDIA;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getPlayMedia()
  {
    return playMedia;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setPlayMedia(String newPlayMedia)
  {
    String oldPlayMedia = playMedia;
    playMedia = newPlayMedia;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EventXPackage.PLAY_MEDIA__PLAY_MEDIA, oldPlayMedia, playMedia));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getMediaFileName()
  {
    return mediaFileName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMediaFileName(String newMediaFileName)
  {
    String oldMediaFileName = mediaFileName;
    mediaFileName = newMediaFileName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EventXPackage.PLAY_MEDIA__MEDIA_FILE_NAME, oldMediaFileName, mediaFileName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_MEDIA__PLAY_MEDIA:
        return getPlayMedia();
      case EventXPackage.PLAY_MEDIA__MEDIA_FILE_NAME:
        return getMediaFileName();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_MEDIA__PLAY_MEDIA:
        setPlayMedia((String)newValue);
        return;
      case EventXPackage.PLAY_MEDIA__MEDIA_FILE_NAME:
        setMediaFileName((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_MEDIA__PLAY_MEDIA:
        setPlayMedia(PLAY_MEDIA_EDEFAULT);
        return;
      case EventXPackage.PLAY_MEDIA__MEDIA_FILE_NAME:
        setMediaFileName(MEDIA_FILE_NAME_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case EventXPackage.PLAY_MEDIA__PLAY_MEDIA:
        return PLAY_MEDIA_EDEFAULT == null ? playMedia != null : !PLAY_MEDIA_EDEFAULT.equals(playMedia);
      case EventXPackage.PLAY_MEDIA__MEDIA_FILE_NAME:
        return MEDIA_FILE_NAME_EDEFAULT == null ? mediaFileName != null : !MEDIA_FILE_NAME_EDEFAULT.equals(mediaFileName);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (playMedia: ");
    result.append(playMedia);
    result.append(", mediaFileName: ");
    result.append(mediaFileName);
    result.append(')');
    return result.toString();
  }

} //PlayMediaImpl
